<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <meta http-equiv="X-UA-Compatible" content="ie=edge" />
    <title>Document</title>
  </head>

  <body>
    <script>
      window.log = console.log;
    </script>
    <script src="/dist/vue.js"></script>
    <div id="app" style="color: green">
      <div>{{fullName}}</div>
    </div>

    <script>
      const options = {
        el: "#app",
        data() {
          return {
            firstName: "张",
            lastName: "三",
          };
        },

        computed: {
          fullName() {
            return this.firstName + this.lastName;
          },
        },
      };
      const vm = new Vue(options);
      // log(vm.fullName);

      setTimeout(() => {
        vm.firstName = "李";
        // vm.lastName = "四";
        // log(vm.fullName);
      }, 2000);
    </script>
  </body>
</html>
